﻿namespace WMS6.Web.Inbound
{
    using System;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;
    using WMS6.Web;

    public class PalletizingQuery : BasePage
    {
        protected Button btnExport;
        protected Button btnList;
        protected Button btnNew;
        protected Button btnSearch;
        protected DropDownList ddlCarrierID;
        protected DropDownList ddlExpectedReceiptDate;
        protected DropDownList ddlExternReceiptID;
        protected DropDownList ddlOwnerID;
        protected DropDownList ddlReceiptID;
        protected HtmlForm F4015;
        protected HtmlInputHidden hdnActionID;
        protected HtmlInputHidden hdncalendarFlag;
        protected HtmlInputHidden hdnDataFormat;
        protected HtmlHead Head1;
        protected HtmlImage img1;
        protected HtmlImage img2;
        protected Label lblCarrierID;
        protected Label lblExpectedReceiptDate;
        protected Label lblExternReceiptID;
        protected Label lblOwnerID;
        protected Label lblReceiptID;
        protected Label lblSys_Code;
        protected HtmlLink mycss;
        protected TextBox txtCarrierID;
        protected TextBox txtExpectedReceiptDate;
        protected TextBox txtExpectedReceiptDate2;
        protected TextBox txtExternReceiptID;
        protected TextBox txtOwnerID;
        protected TextBox txtReceiptID;

        protected void btnSearch_Click(object sender, EventArgs e)
        {
            base.Server.Transfer("PalletizingList.aspx", false);
        }

        private void LoadDDl()
        {
            base.InitQueryDDL(this.ddlReceiptID, 0);
            base.InitQueryDDL(this.ddlExternReceiptID, 0);
            base.InitQueryDDL(this.ddlOwnerID, 0);
            base.InitQueryDDL(this.ddlCarrierID, 0);
            base.InitQueryDDL(this.ddlExpectedReceiptDate, 1);
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!base.IsPostBack)
            {
                base.InitPage(this.Page);
                this.LoadDDl();
            }
        }

        public string CarrierID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtCarrierID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtCarrierID.Text.Trim(), this.ddlCarrierID.SelectedValue);
                }
                return "";
            }
        }

        public string ExpectedReceiptData
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtExpectedReceiptDate.Text.Trim()))
                {
                    return base.GetParamsString(this.txtExpectedReceiptDate.Text.Trim(), this.ddlExpectedReceiptDate.SelectedValue, this.txtExpectedReceiptDate2.Text.Trim(), "ExpectedReceiptDate");
                }
                return "";
            }
        }

        public string ExternReceiptID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtExternReceiptID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtExternReceiptID.Text.Trim(), this.ddlExternReceiptID.SelectedValue);
                }
                return "";
            }
        }

        public string OwnerID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtOwnerID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtOwnerID.Text.Trim(), this.ddlOwnerID.SelectedValue);
                }
                return "";
            }
        }

        public string ReceiptID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtReceiptID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtReceiptID.Text.Trim(), this.ddlReceiptID.SelectedValue);
                }
                return "";
            }
        }
    }
}

